<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@include file="../included/commons.jsp"%>
<title>
文档浏览器
</title>
</head>

<body onload="soaOpen();window.focus();" onunload="soaClose();">
<script language="javascript">
	var bDocOpen = false;
	var action = "${param.action}";
	var tid = "${param.tid}";
	var model = ${param.model}
	function soaOpen() 
	{ 
	    
		try {
		    var params = "&wid=${param.workflowid}&syear=${param.syear}&smonth=${param.smonth}";
			formData.SOAOfficeCtrl.SaveDocURL = 'extension?action=save'+params;    
			if(action == "new"){
			    formData.SOAOfficeCtrl.WebOpen('template?action=view'+params+"&tid="+tid,0,'${loginuser.localName}','Excel.Sheet');
			}else if(action == "view"){
			   //alert("extension?action=view"+params);
			    formData.SOAOfficeCtrl.WebOpen("extension?action=view"+params,0,"${loginuser.localName}","Excel.Sheet");
			}			
		}
		catch (e)
		{
		   
           alert("打开文档失败 \n消息: "+e.message);
		}
	} 
	function soaClose()
	{
		try {
			if (bDocOpen)
				formData.SOAOfficeCtrl.Close();
			return true; 
		} 
		catch (e) 
		{ 
			alert("关闭文档失败!\n错误信息："+e.message); 
			return false; 
		} 
	}
</script>
<SCRIPT language="JavaScript" event="OnDocumentOpened(str, obj)"
	for="SOAOfficeCtrl">
			bDocOpen = true;
		</SCRIPT>
<SCRIPT language="JavaScript" event="OnDocumentClosed()"
	for="SOAOfficeCtrl">
			bDocOpen = false;
		</SCRIPT>
<form name="formData" method="post" id="formData">
<%@ include	file="../soaobject.jsp"%>
</form>
</body>
</html>
